package com.phospherus.common.controller;

import com.phospherus.common.service.ISerialNumberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author songjinlong
 * @version 1.0
 * @since 2018/1/5
 */
@Controller
@RequestMapping("/common/sn")
public class SerialNumberController {
    @Autowired
    ISerialNumberService serialNumberService;

    @RequestMapping("/nextSn")
    @ResponseBody
    public String getNextSn(String year) {
        return String.format("%05d", serialNumberService.getNextNum(year));
    }
}
